home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club (Business) 1997 July / Software of the Month Club - Business (Volume 239) (July 1997).iso / pc / code / f.dxr / 00005_F function scripts.ls next >
Encoding:
Text File  |  1996-02-19  |  13.1 KB  |  408 lines

  1. global gObjects, gStates, void, gCursorlist, sQTCharSprite, gCDNotes, gMIDIPlayTRUE, gKeyRef
  2.  
  3. on EnterF01
  4.   if voidp(getaProp(getaProp(gStates, #BeenThere), #F01)) then
  5.     PDARelease("J05fores.mov")
  6.   end if
  7. end
  8.  
  9. on CalcTransToF63 Test
  10.   if Test = #Debug then
  11.     return [#F63A, #F63B]
  12.   end if
  13.   if getaProp(getaProp(gObjects, #Scanner), #solved) = #false then
  14.     return #F63A
  15.   else
  16.     if getaProp(getaProp(gObjects, #Scanner), #solved) = #true then
  17.       return #F63B
  18.     end if
  19.   end if
  20. end
  21.  
  22. on goToEFork
  23.   hideMapMap()
  24.   genexitkf(#E06F)
  25. end
  26.  
  27. on hideMapMap
  28.   set OBj to getaProp(gObjects, #MapOBj)
  29.   if getaProp(OBj, #State) = #map then
  30.     DelObjects(getaProp(getaProp(OBj, #SpecialChild), #map))
  31.     MakeDynamic(#MapOBj, #State, #NoMAP)
  32.   end if
  33. end
  34.  
  35. on calcTransToF68 Test
  36.   if Test = #Debug then
  37.     return [#F68A, #F68B]
  38.   end if
  39.   if getaProp(getaProp(gObjects, #Scanner), #solved) = #false then
  40.     return #F68A
  41.   else
  42.     if getaProp(getaProp(gObjects, #Scanner), #solved) = #true then
  43.       return #F68B
  44.     end if
  45.   end if
  46. end
  47.  
  48. on calcTransToF70 Test
  49.   if Test = #Debug then
  50.     return [#F70A, #F70B]
  51.   end if
  52.   if getaProp(getaProp(gObjects, #Scanner), #solved) = #false then
  53.     return #F70A
  54.   else
  55.     if getaProp(getaProp(gObjects, #Scanner), #solved) = #true then
  56.       return #F70B
  57.     end if
  58.   end if
  59. end
  60.  
  61. on CalcTransToF73 Test
  62.   if Test = #Debug then
  63.     return [#F73A, #F73B, #F73C, #F73D]
  64.   end if
  65.   if getaProp(getaProp(gObjects, #Scanner), #solved) = #false then
  66.     if getaProp(getaProp(gObjects, #SeedObj), #Aquired) = #false then
  67.       return #F73A
  68.     else
  69.       return #F73D
  70.     end if
  71.   else
  72.     if getaProp(getaProp(gObjects, #Scanner), #solved) = #true then
  73.       if getaProp(getaProp(gObjects, #SeedObj), #Aquired) = #false then
  74.         return #F73B
  75.       else
  76.         return #F73C
  77.       end if
  78.     end if
  79.   end if
  80. end
  81.  
  82. on DoDie
  83.   Startthetimer(1, "goDeath")
  84. end
  85.  
  86. on goDeath
  87.   genexitkf(#FDie)
  88. end
  89.  
  90. on DoF02ForwardNav
  91.   if (getaProp(getaProp(gObjects, #F02ForwardNav), #timesAttempted) = 0) and ((getaProp(getaProp(gObjects, #BagObj), #Aquired) = #false) or (getaProp(getaProp(gObjects, #MapOBj), #Aquired) = #false)) then
  92.     set timesAttempted to getaProp(getaProp(gObjects, #F02ForwardNav), #timesAttempted)
  93.     set timesAttempted to timesAttempted + 1
  94.     MakeDynamic(#F02ForwardNav, #timesAttempted, timesAttempted)
  95.     killFAmbientSound()
  96.     playSound("F01rmap.aif", #keyframeFile)
  97.     set soundSymbol to value("#" & "F01rmap.aif")
  98.     set soundTicks to getaProp(getaProp(getaProp(gObjects, #F02ForwardNav), #VOTicks), soundSymbol)
  99.     set soundTimer to Startthetimer(soundTicks + 30, "restartFAmbientSound", #F02ForwardNav)
  100.   else
  101.     genexitkf(#F65)
  102.   end if
  103. end
  104.  
  105. on exitF02
  106.   if not voidp(getaProp(getaProp(gObjects, #F02ForwardNav), #timer)) then
  107.     DeletetheTimer(getAt(getaProp(getaProp(gObjects, #F02ForwardNav), #timer), 1))
  108.   end if
  109. end
  110.  
  111. on doRangerBethVid2
  112.   set OBj to getaProp(gObjects, #RangerBeth)
  113.   set the movieTime of sprite getaProp(OBj, #SpriteNum) to 0
  114.   set the movieRate of sprite getaProp(OBj, #SpriteNum) to 1
  115. end
  116.  
  117. on enterF04
  118.   set OBJref to #RangerBeth
  119.   set OBj to getaProp(gObjects, OBJref)
  120.   hideMapMap()
  121.   initCDDancing()
  122.   if getaProp(getaProp(gObjects, #Scanner), #solved) = #true then
  123.     set thisPlayList to 6
  124.     MakeDynamic(#RangerBeth, #Condition, 6)
  125.     MakeDynamic(#RangerBeth, #DisplayState, 6)
  126.     MakeDynamic(#RangerBeth, #DisplayCount, #random)
  127.   else
  128.     if (getaProp(getaProp(gStates, #BeenThere), #F69) > 0) and (getaProp(getaProp(gObjects, #Scanner), #solved) = #false) then
  129.       MakeDynamic(#RangerBeth, #Condition, 3)
  130.       MakeDynamic(#RangerBeth, #DisplayState, 3)
  131.       set thisPlayList to 3
  132.       set lastMoviePlayedIndex to getLastMoviePlayedIndex(OBJref)
  133.       setLastMoviePlayedList(OBJref, lastMoviePlayedIndex + 1)
  134.     else
  135.       if (getaProp(getaProp(gStates, #BeenThere), #F65) > 0) and (getaProp(getaProp(gStates, #BeenThere), #F69) = 0) then
  136.         MakeDynamic(#RangerBeth, #Condition, 2)
  137.         MakeDynamic(#RangerBeth, #DisplayState, 2)
  138.         set thisPlayList to 2
  139.         set lastMoviePlayedIndex to getLastMoviePlayedIndex(OBJref)
  140.         setLastMoviePlayedList(OBJref, lastMoviePlayedIndex + 1)
  141.       else
  142.         if getaProp(getaProp(gStates, #BeenThere), #F65) = 0 then
  143.           MakeDynamic(#RangerBeth, #Condition, 1)
  144.           MakeDynamic(#RangerBeth, #DisplayState, 1)
  145.           set thisPlayList to 1
  146.           set lastMoviePlayedIndex to getLastMoviePlayedIndex(OBJref)
  147.           setLastMoviePlayedList(OBJref, lastMoviePlayedIndex + 1)
  148.         end if
  149.       end if
  150.     end if
  151.   end if
  152. end
  153.  
  154. on initCDDancing
  155.   set OBJref to #RangerBeth
  156.   set OBj to getaProp(gObjects, OBJref)
  157.   MakeDynamic(#RangerBeth, #TimesCDPlayed, 0)
  158.   MakeDynamic(#RangerBeth, #Condition, 4)
  159.   MakeDynamic(#RangerBeth, #DisplayState, 4)
  160.   set newCDMovieIndex to 0
  161.   setLastMoviePlayedList(#RangerBeth, newCDMovieIndex)
  162.   MakeDynamic(#RangerBeth, #Condition, 5)
  163.   MakeDynamic(#RangerBeth, #DisplayState, 5)
  164.   set newCDMovieIndex to 0
  165.   setLastMoviePlayedList(#RangerBeth, newCDMovieIndex)
  166. end
  167.  
  168. on doRangerBethVid playType
  169.   set OBJref to #RangerBeth
  170.   set OBj to getaProp(gObjects, OBJref)
  171.   if getaProp(OBj, #TimesCDPlayed) > 0 then
  172.     if getaProp(OBj, #TimesCDPlayed) = 1 then
  173.       MakeDynamic(#RangerBeth, #Condition, 4)
  174.       MakeDynamic(#RangerBeth, #DisplayState, 4)
  175.       if getLastMoviePlayedIndex(#RangerBeth) = 0 then
  176.         setLastMoviePlayedList(#RangerBeth, 0)
  177.       end if
  178.       DoCharacterMovie(#RangerBeth)
  179.       set newIndex to getaProp(OBj, #ConCount)
  180.       setLastMoviePlayedList(#RangerBeth, newIndex)
  181.     else
  182.       if getaProp(OBj, #TimesCDPlayed) > 1 then
  183.         MakeDynamic(#RangerBeth, #Condition, 5)
  184.         MakeDynamic(#RangerBeth, #DisplayState, 5)
  185.         if playType = #CDPlay then
  186.           set newIndex to 0
  187.           setLastMoviePlayedList(#RangerBeth, 0)
  188.         end if
  189.         if getLastMoviePlayedIndex(#RangerBeth) = 0 then
  190.           setLastMoviePlayedList(#RangerBeth, 0)
  191.         end if
  192.         DoCharacterMovie(#RangerBeth)
  193.         set newIndex to getaProp(OBj, #ConCount)
  194.         setLastMoviePlayedList(#RangerBeth, newIndex)
  195.       end if
  196.     end if
  197.   else
  198.     if (getaProp(OBj, #Condition) <> 4) or (getaProp(OBj, #Condition) <> 5) then
  199.       DoCharacterMovie(#RangerBeth)
  200.       set newIndex to getaProp(OBj, #ConCount)
  201.       setLastMoviePlayedList(#RangerBeth, newIndex)
  202.     end if
  203.   end if
  204. end
  205.  
  206. on getLastMoviePlayedIndex OBJref
  207.   set OBj to getaProp(gObjects, OBJref)
  208.   set lastMoviesPlayedList to getaProp(OBj, #lastMoviesPlayed)
  209.   set lastPlayListNum to getaProp(OBj, #Condition)
  210.   set lastMoviePlayedIndex to getaProp(lastMoviesPlayedList, lastPlayListNum)
  211.   return lastMoviePlayedIndex
  212. end
  213.  
  214. on setLastMoviePlayedList OBJref, index
  215.   set OBj to getaProp(gObjects, OBJref)
  216.   MakeDynamic(OBJref, #ConCount, index)
  217.   set lastMoviesPlayedList to getaProp(OBj, #lastMoviesPlayed)
  218.   set lastPlayListNum to getaProp(OBj, #Condition)
  219.   set lastPlayList to getaProp(getaProp(OBj, #cast), lastPlayListNum)
  220.   set totalMovieCount to count(lastPlayList)
  221.   if index < totalMovieCount then
  222.     setaProp(lastMoviesPlayedList, lastPlayListNum, index)
  223.     MakeDynamic(OBJref, #ConCount, index)
  224.     MakeDynamic(OBJref, #DisplayCount, index)
  225.   else
  226.     setaProp(lastMoviesPlayedList, lastPlayListNum, totalMovieCount)
  227.     MakeDynamic(OBJref, #ConCount, totalMovieCount)
  228.     MakeDynamic(OBJref, #DisplayCount, totalMovieCount)
  229.   end if
  230.   MakeDynamic(OBJref, #lastMoviesPlayed, lastMoviesPlayedList)
  231. end
  232.  
  233. on setCDPlays inNumberPlays
  234.   MakeDynamic(#RangerBeth, #TimesCDPlayed, inNumberPlays)
  235. end
  236.  
  237. on enterF67A
  238.   hideMapMap()
  239.   set OBj to getaProp(gObjects, #Fenrsley67)
  240.   setaProp(OBj, #ConCount, 1)
  241.   MakeDynamic(#Fenrsley67, #ConCount, 1)
  242.   if getaProp(getaProp(gObjects, #scanpapers), #State) = #on then
  243.     MakeDynamic(#Fenrsley67, #Condition, 4)
  244.     MakeDynamic(#Fenrsley67, #DisplayState, 4)
  245.     MakeDynamic(#Fenrsley67NavRectParent, #State, #NavOn)
  246.   else
  247.     if (getaProp(getaProp(gObjects, #scanpapers), #State) = #off) and (getaProp(getaProp(gStates, #BeenThere), #F67A) > 2) then
  248.       MakeDynamic(#Fenrsley67, #Condition, 2)
  249.       MakeDynamic(#Fenrsley67, #DisplayState, 2)
  250.     else
  251.       if (getaProp(getaProp(gObjects, #scanpapers), #State) = #off) and (getaProp(getaProp(gStates, #BeenThere), #F67A) = 2) then
  252.         MakeDynamic(#Fenrsley67, #Condition, 3)
  253.         MakeDynamic(#Fenrsley67, #DisplayState, 3)
  254.       else
  255.         if (getaProp(getaProp(gObjects, #scanpapers), #State) = #off) and (getaProp(getaProp(gStates, #BeenThere), #F67A) = 1) then
  256.           MakeDynamic(#Fenrsley67, #Condition, 2)
  257.           MakeDynamic(#Fenrsley67, #DisplayState, 2)
  258.         else
  259.           if (getaProp(getaProp(gObjects, #scanpapers), #State) = #off) and (getaProp(getaProp(gStates, #BeenThere), #F67A) = 0) then
  260.             MakeDynamic(#Fenrsley67, #Condition, 1)
  261.             MakeDynamic(#Fenrsley67, #DisplayState, 1)
  262.           end if
  263.         end if
  264.       end if
  265.     end if
  266.   end if
  267. end
  268.  
  269. on doFenrsley67Vid
  270.   set OBj to getaProp(gObjects, #Fenrsley67)
  271.   DoCharacterMovie(#Fenrsley67)
  272. end
  273.  
  274. on enterF68A
  275.   hideMapMap()
  276.   set OBj to getaProp(gObjects, #Fenrsley68)
  277.   MakeDynamic(#Fenrsley68, #ConCount, 1)
  278.   MakeDynamic(#Fenrsley68, #DisplayCount, 1)
  279.   if (getaProp(getaProp(gObjects, #Scanner), #solved) = #false) and (getaProp(getaProp(gStates, #BeenThere), #F73A) >= 1) then
  280.     MakeDynamic(#Fenrsley68, #Condition, 3)
  281.     MakeDynamic(#Fenrsley68, #DisplayState, 3)
  282.   else
  283.     if (getaProp(getaProp(gObjects, #Scanner), #solved) = #false) and (getaProp(getaProp(gStates, #BeenThere), #F69) > 1) then
  284.       MakeDynamic(#Fenrsley68, #Condition, 2)
  285.       MakeDynamic(#Fenrsley68, #DisplayState, 2)
  286.       MakeDynamic(#Fenrsley68, #ConCount, 2)
  287.       MakeDynamic(#Fenrsley68, #DisplayCount, 2)
  288.     else
  289.       if (getaProp(getaProp(gObjects, #Scanner), #solved) = #false) and (getaProp(getaProp(gStates, #BeenThere), #F69) = 1) then
  290.         MakeDynamic(#Fenrsley68, #Condition, 2)
  291.         MakeDynamic(#Fenrsley68, #DisplayState, 2)
  292.       else
  293.         if getaProp(getaProp(gStates, #BeenThere), #F68A) >= 0 then
  294.           MakeDynamic(#Fenrsley68, #Condition, 1)
  295.           MakeDynamic(#Fenrsley68, #DisplayState, 1)
  296.         end if
  297.       end if
  298.     end if
  299.   end if
  300. end
  301.  
  302. on enterF68B
  303.   hideMapMap()
  304.   set OBj to getaProp(gObjects, #Fernsley68)
  305.   MakeDynamic(#Fenrsley68, #ConCount, 1)
  306.   MakeDynamic(#Fenrsley68, #DisplayCount, 1)
  307.   if getaProp(getaProp(gStates, #BeenThere), #F68B) >= 1 then
  308.     MakeDynamic(#Fenrsley68, #Condition, 5)
  309.     MakeDynamic(#Fenrsley68, #DisplayState, 5)
  310.   else
  311.     MakeDynamic(#Fenrsley68, #Condition, 4)
  312.     MakeDynamic(#Fenrsley68, #DisplayState, 4)
  313.   end if
  314. end
  315.  
  316. on enterF71A
  317.   if (getaProp(getaProp(gStates, #BeenThere), #F71A) = 0) and (getaProp(getaProp(gStates, #BeenThere), #F71B) = 0) then
  318.     PDARelease("J04m22p.mov")
  319.   else
  320.     if (getaProp(getaProp(gStates, #BeenThere), #F71A) = 1) or (getaProp(getaProp(gStates, #BeenThere), #F71B) = 1) then
  321.       PDARelease("J04m23p.mov")
  322.     end if
  323.   end if
  324. end
  325.  
  326. on enterF71B
  327.   if (getaProp(getaProp(gStates, #BeenThere), #F71A) = 0) and (getaProp(getaProp(gStates, #BeenThere), #F71B) = 0) then
  328.     PDARelease("J04m22p.mov")
  329.   else
  330.     if (getaProp(getaProp(gStates, #BeenThere), #F71A) = 1) or (getaProp(getaProp(gStates, #BeenThere), #F71B) = 1) then
  331.       PDARelease("J04m23p.mov")
  332.     end if
  333.   end if
  334. end
  335.  
  336. on doFenrsley68Vid
  337.   DoCharacterMovie(#Fenrsley68)
  338. end
  339.  
  340. on jk67
  341.   Jumptokey(#F67A)
  342. end
  343.  
  344. on jk68a
  345.   Jumptokey(#F68A)
  346. end
  347.  
  348. on jk68b
  349.   Jumptokey(#F68B)
  350. end
  351.  
  352. on AddMaptoUnv
  353.   set OBj to getaProp(gObjects, #MapHotrect)
  354.   playSound("Click.aif", #keyframeCast)
  355.   AddObjects([#MapOBj])
  356.   MakeDynamic(#MapOBj, #Aquired, #true)
  357.   MakeDynamic(#MapHotrect, #Hotrect, [rect(0, 0, 0, 0)])
  358.   set hotrectnum to integer(getaProp(OBj, #SpriteNum) & "01")
  359.   deleteProp(gHotRects, hotrectnum)
  360. end
  361.  
  362. on AddLittertoUnv
  363.   set OBj to getaProp(gObjects, #LitterHotrect)
  364.   playSound("Click.aif", #keyframeCast)
  365.   AddObjects([#BagObj])
  366.   MakeDynamic(#BagObj, #Aquired, #true)
  367.   MakeDynamic(#LitterHotrect, #Hotrect, [rect(0, 0, 0, 0)])
  368.   set hotrectnum to integer(getaProp(OBj, #SpriteNum) & "01")
  369.   deleteProp(gHotRects, hotrectnum)
  370. end
  371.  
  372. on AddSeedtoUnvB
  373.   playSound("Click.aif", #keyframeCast)
  374.   AddObjects([#SeedObj])
  375.   MakeDynamic(#SeedObj, #Aquired, #true)
  376.   Jumptokey(#F73C)
  377. end
  378.  
  379. on AddSeedtoUnvA
  380.   playSound("Click.aif", #keyframeCast)
  381.   AddObjects([#SeedObj])
  382.   MakeDynamic(#SeedObj, #Aquired, #true)
  383.   Jumptokey(#F73D)
  384. end
  385.  
  386. on PaperFind OBJref
  387.   set OBj to getaProp(gObjects, OBJref)
  388.   set Papers to getaProp(gObjects, #scanpapers)
  389.   if getaProp(getaProp(gObjects, #BagObj), #Aquired) = #true then
  390.     set papersFound to getaProp(Papers, #Children)
  391.     add(papersFound, getaProp(OBj, #pageNum))
  392.     MakeDynamic(#scanpapers, #Children, papersFound)
  393.     if not voidp(getaProp(getaProp(OBj, #sound), #down)) then
  394.       playSound(getaProp(getaProp(OBj, #sound), #down), #keyframeCast)
  395.     end if
  396.     if count(getaProp(Papers, #Children)) = 16 then
  397.       MakeDynamic(#scanpapers, #State, #on)
  398.     else
  399.       MakeDynamic(#scanpapers, #State, #off)
  400.     end if
  401.     MakeDynamic(OBJref, #Hotrect, [rect(0, 0, 0, 0)])
  402.     MakeDynamic(OBJref, #DisplayState, #false)
  403.     set hotrectnum to integer(getaProp(OBj, #SpriteNum) & "01")
  404.     deleteProp(gHotRects, hotrectnum)
  405.     set the loc of sprite getaProp(OBj, #SpriteNum) to point(-2000, -2000)
  406.   end if
  407. end
  408.